<div class="panel-sidebar-header">
    <div>{{=XML(T('Welcome'))}}</div>
</div>
<div class="panel-sidebar">
    <div class="panel-sidebar-content">
        <div>&middot;&nbsp;<a href="{{=URL(r=request, c='default', f='index')}}" title="{{=XML(T('Forum Home'))}}">{{=XML(T('Forum Home'))}}</a></div>
        {{if auth_user.is_auth():}}
            <div>&middot;&nbsp;<a href="{{=URL(r=request, c='default', f='logout')}}" title="{{=XML(T('Logout'))}}">{{=XML(T('Logout'))}} {{=auth_user.get_user_name()}}</a></div>
            <div>&middot;&nbsp;<a href="{{=URL(r=request, c='default', f='preferences')}}" title="{{=XML(T('My Preferences'))}}">{{=XML(T('My Preferences'))}}</a></div>
            <div>&middot;&nbsp;<a href="{{=URL(r=request, c='pm', f='index')}}" title="{{=XML(T('My Messages'))}}">{{=XML(T('My Messages'))}} {{=XML(forumhelper.get_my_messages_cnt())}}</a></div>
        {{else:}}
            <!-- User is not logged in //-->
            <form id="login_form_sidenav" method="post" action="{{=URL(r=request, c='default', f='login')}}">
                <fieldset id="login_form_sidenav_fields">
                    <input type="hidden" id="form_subitted" name="form_submitted" value="1" />
                    <table cellspacing="0" cellpadding="0" class="block-centered">
                        <tbody>
                            <tr>
                                <td>{{=XML(T('Username'))}}:</td>
                                <td style="text-align:right;"><input type="text" id="auth_alias" name="auth_alias" value="" style="width:100px;" /></td>
                            </tr>
                            <tr>
                                <td>{{=XML(T('Password'))}}:</td>
                                <td style="text-align:right;"><input type="password" id="passwd" name="passwd" value="" style="width:100px;" /></td>
                            </tr>
                            <tr>
                                <td colspan="2"><label for="google_account">{{=XML(T('This is a Google Account'))}}</label> <input type="checkbox" id="google_account" name="google_account" /></td>
                            </tr>
                            <tr>
                                <td colspan="2" style="text-align:right;">
                                    <div style="margin-top:5px;">
                                        <input type="submit" id="login_b" name="login_b" value="{{=XML(T('Log In'))}}" />
                                        <input type="submit" id="register_b" name="register_b" value="{{=XML(T('Register'))}}" />
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </fieldset>
            </form>
        {{pass}}
        <div>&middot;&nbsp;<a href="{{=URL(r=request, c='default', f='contact_admin')}}"
                      title="{{=XML(T('Contact Forum Administrator'))}}">{{=XML(T('Contact Forum Administrator'))}}</a></div>
        <div>&nbsp;</div>
        <form id="search_form" method="post" action="{{=URL(r=request, c='default', f='search')}}">
            <fieldset id="search_form_fields">
                <table cellspacing="0" cellpadding="0" class="block-centered">
                    <tbody>
                        <tr>
                            <td>{{=XML(T('Quick Search'))}}:</td>
                            <td><input type="text" id="search_str" name="search_str" value="" class="formelem" style="width:100px;" /></td>
                        </tr>
                        <tr>
                            <td colspan="2" style="text-align:right;"><input type="submit" class="formelem" id="search_b" name="search_b" value="{{=XML(T('Search'))}}" /></td>
                        </tr>
                    </tbody>
                </table>
            </fieldset>
        </form>
        {{if auth_user.has_role('zAdministrator'):}}
            <div>&nbsp;</div>
            <div>&middot;&nbsp;<a href="{{=URL(r=request, c='zadmin', f='index')}}" title="{{=XML(T('Forum Administration'))}}">{{=XML(T('Forum Administration'))}}</a></div>
        {{pass}}
    </div>
</div>

<div class="panel-sidebar-header">
    <div>{{=XML(T('System Announcements'))}}</div>
</div>
<div class="panel-sidebar">
    <div class="panel-sidebar-content">
        {{for sys_topic in forumhelper.get_system_announcements():}}
            {{if sys_topic.has_key('error'):}}
                <div>&middot;&nbsp;=- {{=XML(T('No Topics Found'))}} -=</div>
            {{else:}}
                <div>&middot;&nbsp;{{=XML(T(str(sys_topic.get('modifying_date', request.now).strftime('%d/%m/%y'))))}}&nbsp;<a href="{{=URL(r=request, c='default', f='view_topic', args=[sys_topic.id])}}" title="{{=sys_topic.get('title', '').replace('"', '')}}" class="small-link-sidenav">{{=sys_topic.get('title', '')[:30]}} ..</a></div>
            {{pass}}
        {{pass}}
        <div style="text-align:right;margin-top:20px;"><a href="{{=URL(r=request, c='default', f='rss', args=['system'])}}"
             title="{{=XML(T('RSS Feed'))}}"><img src="{{=URL(r=request, c='static/images', f='feed-icon-14x14.png')}}" alt="{{=XML(T('RSS Feed'))}}"
             class="imgclear" /></a>&nbsp;&nbsp;</div>
    </div>
</div>

<div class="panel-sidebar-header">
    <div>{{=XML(T('Latest Posts'))}}</div>
</div>
<div class="panel-sidebar">
    <div class="panel-sidebar-content">
        {{for latest_topic in forumhelper.get_latest_topics():}}
            {{if latest_topic.has_key('error'):}}
                <div>&middot;&nbsp;=- {{=XML(T('No Topics Found'))}} -=</div>
            {{else:}}
                <div>&middot;&nbsp;{{=XML(T(str(latest_topic.get('modifying_date', request.now).strftime('%d/%m/%y'))))}}&nbsp;<a href="{{=URL(r=request, c='default', f='view_topic', args=[latest_topic.get('id', '')])}}" title="{{=latest_topic.get('title', '').replace('"', '')}}" class="small-link-sidenav">{{=latest_topic.get('title', '')[:30]}} ..</a></div>
            {{pass}}
        {{pass}}
        <div style="text-align:right;margin-top:20px;"><a href="{{=URL(r=request, c='default', f='rss', args=['latest'])}}"
             title="{{=XML(T('RSS Feed'))}}"><img src="{{=URL(r=request, c='static/images', f='feed-icon-14x14.png')}}" alt="{{=XML(T('RSS Feed'))}}"
             class="imgclear" /></a>&nbsp;&nbsp;</div>
    </div>
</div>
